package com.itaming.lycheeframework.validation.constraints;

import com.itaming.lycheeframework.validation.validators.ChineseIdCardValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * 大陆身份证号码校验注解
 *
 * @author A.Ming
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Constraint(validatedBy = {ChineseIdCardValidator.class})
public @interface ChineseIdCard {

    /**
     * 错误消息
     */
    String message() default "身份证号码格式不正确";

    /**
     * 校验分组
     */
    Class<?>[] groups() default {};

    /**
     * 载荷信息
     */
    Class<? extends Payload>[] payload() default {};

}
